//
//  YMFMainTabController.swift
//  FlyingPigeon
//
//  Created by yang on 2019/5/22.
//  Copyright © 2019年 a. All rights reserved.
//

import Foundation
import UIKit

class YMFMainTabController: UITabBarController {
    override func viewDidLoad() {
        super.viewDidLoad()
        
        let homeVC = YMFHomeViewController(nibName: "YMFHomeViewController", bundle: nil)
        let homeNav = YMFNavigationController(rootViewController: homeVC)
        homeNav.tabBarItem = UITabBarItem(title: "首页", image:  UIImage(named: "icon_car"), tag: 111)
        
        let orderNav = YMFNavigationController(rootViewController: YMFOrderViewController())
        orderNav.tabBarItem = UITabBarItem(title: "订单", image:  UIImage(named: "订单"), tag: 222)
        
        let myNav = YMFNavigationController(rootViewController: YMFMyViewController())
        myNav.tabBarItem = UITabBarItem(title: "我的", image:  UIImage(named: "我的"), tag: 333)
        
//        viewControllers = [YMFNavigationController(rootViewController: homeVC), YMFNavigationController(rootViewController: YMFOrderViewController()), YMFNavigationController(rootViewController:YMFMyViewController())]
//        setViewControllers([homeNav, orderNav], animated: true)
//
//        selectedIndex = 0
        
        addChildViewController(homeNav)
        addChildViewController(orderNav)
        addChildViewController(myNav)
       
        
    }
}
